﻿@{
    Layout = null;
}
<script>
    function SearchDB() {
        $('#pageIndexNow').val('1');//每次点击检索将页码初始化为1
        var searchname = $("#dbname").val();
        $("#hiddendbname").val(searchname);
        SearchData();
    }
    $(document).keydown(function (event) {
        if (event.keyCode == 13) {
            SearchDB();
        }
    });
    //点击分页
    function searchPageNew(n) {
        $('#pageIndexNow').val(n);
        SearchData();
    }
    $(function () {
        SearchData();
        //单选按钮点击触发事件
        $(".f-radio").click(function () {
            $('#pageIndexNow').val(1);
            SearchData();
        })
    })
    function SearchData() {
        var searchForm = $('#searchForm');
        searchForm.submit();
    }
    function CreateDrsXmlM() {
        $.ajax({
            type: "POST",
            url: "@Html.Raw(Url.Action("CreateDrsXmlM", "Admin_MultiDBPublish"))",
            beforeSend: function () { $("#loading").show() },
            success: function (msg) {
                if (msg) {
                    $("#loading").hide();
                    messageAlert("操作成功！");
                }
                else {
                    $("#loading").hide();
                    messageAlert("操作失败！");
                }
            },
            error: function (e)
            { }
        })
    }
</script>

<!-- wrapRStart -->
<div class="wrapR-h">
    <div class="form form-h" style="padding-top:20px">
        @using (Ajax.BeginForm("Search", new { }, new AjaxOptions()
                {
                    HttpMethod = "post",
                    InsertionMode = InsertionMode.Replace,
                    UpdateTargetId = "docListMapping",
                    LoadingElementId = "loadingmapping"
                }, new { id = "searchForm" }))
        { 
            <fieldset>
                <input type="hidden" id="pageIndexNow" name="pageIndexNow" value="1" />
                   <input type="hidden" class="f-text span4" id="hiddendbname" name="hiddendbname" >
                <div class="wrapR-t f-gp"  >
                    <label class="f-label" style="text-decoration:none;cursor:default;">
                        设置状态：</label>
                    <label class="f-label" >
                        <input type="radio" name="type" class="f-radio" checked="checked" value="all">全部</label>
                    <label class="f-label">
                        <input type="radio" name="type" class="f-radio" value="1" >已设置</label>
                    <label class="f-label">
                        <input type="radio" name="type" class="f-radio" value="0">待设置</label>
                      <span class="f-input-ap block" style="float: right">
                        <a class="btn btn-submit btn-warn-f" href="javascript:void(0);" onclick="CreateDrsXmlM()">生成DRS映射文件(XML)</a>
                    </span>
                </div>
                 <div class="f-lb">
                    <label class="f-label">数据库名称：</label>
                </div>
                <div class="f-ct f-ml">
                    <input type="text" class="f-text span4" id="dbname" name="dbname" maxlength="255">
                   
                    <a class="btn btn-submit btn-warn-f" onclick="SearchDB()">检索</a>
                </div>
            </fieldset>
        }
    </div>

</div>
<div id="loadingmapping" style="display: none; margin-left: 346px; margin-top: 108px; position: absolute">
    <img src="~/Images/loading.gif" width="50" />
</div>
<div id="docListMapping">
</div>

<!-- wrapREnd -->
